package com.guangyuan.network.mvc.action;

import java.util.HashMap;
import java.util.Map;

import com.guangyuan.network.test.TableMetaAction;

/**
 * @author hanjie.wuhj
 * 主要用来保存整个网站中处理的提交请求的信息
 */
public class ActionMap {	
	
	private static Map<String, Action> map;
	//FIXME 保证映射关系
	static {
		map = new HashMap<String, Action>();
		map.put("productgroupaction", new ProductGroupAction());
		map.put("tablemetaaction", new TableMetaAction());
		map.put("productgroupattraction", new ProductGroupAttrAction());
		map.put("productaction", new ProductAction());
	}
	
	public static Action getAction(String name) {
		if(null == name) {
			return null;
		}
		Action action = map.get(name.toLowerCase());
		return action;
	}
}
